import 'package:flutter/cupertino.dart';
import 'package:flutter1/pages/second_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter1/config_wrapper.dart';
import 'package:flutter1/pages/third_page.dart';
import 'package:flutter1/pages/fourth_page.dart';
import 'package:get/get.dart';

import 'pages/first_page.dart';

void main() {


  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  var count = 0;

  @override
  Widget build(BuildContext context) {
    return GetMaterialApp(
      debugShowCheckedModeBanner: false,
      initialRoute: '/first',
      routes: <String, WidgetBuilder>{
        '/first': (BuildContext ctx) => FirstPage(),
        '/second': (BuildContext ctx) => SecondPage(),
        '/third': (BuildContext ctx) => ThirdPage(),
        '/fourth': (BuildContext ctx) => FourthPage(),
      },
      //  分别两个路由
    );
  }
}

class WidgetA extends StatelessWidget {
  const WidgetA({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Row(
      children: [
        Container(
          child: Text('你好a'),
        ),

        Container(
          child: Text('我只是一个组件'),
        ),
      ],
    );
  }
}

//这是一个实验InheritedWidget的组件
class WidgetB extends StatelessWidget {
  const WidgetB({Key? key}) : super(key: key);
  @override

  Widget build(BuildContext context) {
    return Container(
      child: Text(InheritedState.of(context)!.count.toString()),
    );
  }
}
